python encoding utf-8 Ask Question up vote 28 down vote favorite 10 I am doing some scripts in python. ... utf-8 -*- def createIndex(): import codecs toUtf8=codecs.getencoder('UTF8') #lot of operations & building indexSTR the string who matter